﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Images.xaml" />
    </ResourceDictionary.MergedDictionaries>
    
    <Style x:Key="{x:Type CheckBox}" TargetType="CheckBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            
                            <Border x:Name="Border"  
                                    Width="13" 
                                    Height="13" 
                                    CornerRadius="0" 
                                    Background="{StaticResource MinOpacityBrush}"
                                    BorderThickness="1"
                                    BorderBrush="White">
                                
                                <Canvas Width="10" Height="10" 
                                      x:Name="CheckMark"
                                      SnapsToDevicePixels="False" 
                                      Background="{StaticResource CheckPath}"/>
                            </Border>
                        </BulletDecorator.Bullet>
                        <ContentPresenter Margin="4,0,0,0" 
                                          VerticalAlignment="Center"
                                          HorizontalAlignment="Left"
                                          RecognizesAccessKey="True"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>

                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="BorderBrush" Value="LightGray"/>
                            <Setter TargetName="Border" Property="Background" Value="Gray"/>
                        </Trigger>

                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter TargetName="CheckMark" Property="Background" Value="{StaticResource CheckNonePath}"/>
                        </Trigger>

                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource MidOpacityBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>